/**
 * Created by yuanqiujuan on 2017/7/18.
 */
'use strict';
var url = require('url'),
    path = require('path'),
    express = require('express'),
    http = require('http'),
    proxy = require('http-proxy-middleware'),
    app = express(),
    server = http.createServer(app),
    io = require("socket.io").listen(server),
    socketStart = require("./server/socket"),
    port = 8999;

//监听端口
server.listen(port);

app.use(function (err, req, res, next) {
    console.log(err.stack);
    res.render(500, err.stack);
});

//读取静态资源
app.use('/static', express.static(__dirname + '/static'));
app.use(express.static(__dirname));

//socket连接
socketStart.gobangStart(io);